package hamsterpolice.todo.test.mock;

import android.database.Cursor;
import hamsterpolice.todo.data.Criteria;
import hamsterpolice.todo.data.DataAdapter;
import hamsterpolice.todo.data.DatabaseConstraintException;
import hamsterpolice.todo.data.UnhandledCriteriaException;
import hamsterpolice.todo.model.Category;

public class MockCategoryDataAdapter implements DataAdapter<Category> {
	
	int getCalledCount = 0;
	public int getGetCalledCount(){ return getCalledCount; }

	@Override
	public Cursor get(Criteria<?> criteria) throws UnhandledCriteriaException {
		getCalledCount++;
		return null;
	}
	
	int loadCalledCount = 0;
	public int getLoadCalledCount(){ return loadCalledCount; }

	@Override
	public long load(Cursor c, Category model) {
		loadCalledCount++;
		return 0;
	}
	
	int insertCalledCount = 0;
	public int getInsertCalledCount(){ return insertCalledCount; }

	@Override
	public long insert(Category model) throws DatabaseConstraintException {
		return ++insertCalledCount;
	}

	int updateCalledCount = 0;
	public int getUpdateCalledCount(){ return updateCalledCount; }
	
	@Override
	public boolean update(Category model) throws DatabaseConstraintException {
		updateCalledCount++;
		return false;
	}

	int deleteCalledCount = 0;
	public int getDeleteCalledCount(){ return deleteCalledCount; }
	
	@Override
	public boolean delete(long id) {
		deleteCalledCount++;
		return false;
	}

}
